from django.db import models
from datetime import datetime

from user.models import User

# Create your models here.
class AnhuiCampaign(models.Model):
    class Meta:
        db_table = "word_match_student"
        verbose_name_plural = "成绩榜"
        managed = False

    MATCH_STAGE = (
        (0,'初赛'),
        (1,'复赛'),
    )

    student_name = models.CharField('学生姓名',max_length=20,)
    student_no = models.CharField('学号',max_length=20,)
    college_name = models.CharField('学院名称',max_length=20,)
    group_no = models.IntegerField('组别',)
    mobile = models.CharField('手机号',max_length=20,)
    is_semi = models.IntegerField('比赛阶段',choices=MATCH_STAGE)
    is_final = models.BooleanField('决赛资格',)
    comment = models.CharField('比赛阶段',max_length=1,)
    score_0 = models.IntegerField('初赛分数',)
    score_1 = models.IntegerField('复赛分数',)
    status_0 = models.BooleanField('初赛状态',)
    status_1 = models.BooleanField('复赛状态',)


class AnhuiCampaignCtrl(models.Model):
    class Meta:
        db_table = "word_match_status"
        verbose_name_plural = "控制台"
        managed = False

    MATCH_STATUS = (
        (0,'未开赛'),
        (1,'已开赛'),
        (2,'已结束'),
    )

    MATCH_STAGE = (
        (1,'初赛'),
        (2,'复赛'),
    )

    id = models.IntegerField('比赛ID',primary_key=True,choices=MATCH_STAGE)
    status = models.IntegerField('比赛状态',choices=MATCH_STATUS)

    def __str__(self):
        return str(self.id)
